home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 108 / MacAddict108.iso / Software / Internet & Communication / WordPress 1.5.1.dmg / wordpress / wp-rss2.php < prev    next >
Encoding:
PHP Script  |  2005-02-25  |  2.1 KB  |  57 lines

  1. <?php
  2.  
  3. if (empty($feed)) {
  4.     $blog = 1;
  5.     $feed = 'rss2';
  6.     $doing_rss = 1;
  7.     require('wp-blog-header.php');
  8. }
  9.  
  10. header('Content-type: text/xml; charset=' . get_settings('blog_charset'), true);
  11. $more = 1;
  12.  
  13. ?>
  14. <?php echo '<?xml version="1.0" encoding="'.get_settings('blog_charset').'"?'.'>'; ?>
  15.  
  16. <!-- generator="wordpress/<?php bloginfo_rss('version') ?>" -->
  17. <rss version="2.0" 
  18.     xmlns:content="http://purl.org/rss/1.0/modules/content/"
  19.     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  20.     xmlns:dc="http://purl.org/dc/elements/1.1/"
  21. >
  22.  
  23. <channel>
  24.     <title><?php bloginfo_rss('name'); ?></title>
  25.     <link><?php bloginfo_rss('url') ?></link>
  26.     <description><?php bloginfo_rss("description") ?></description>
  27.     <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubDate>
  28.     <generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator>
  29.     <language><?php echo get_option('rss_language'); ?></language>
  30.  
  31.     <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?>
  32.     <item>
  33.         <title><?php the_title_rss() ?></title>
  34.         <link><?php permalink_single_rss() ?></link>
  35.         <comments><?php comments_link(); ?></comments>
  36.         <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
  37.         <dc:creator><?php the_author() ?></dc:creator>
  38.         <?php the_category_rss() ?>
  39.  
  40.         <guid><?php the_permalink($id); ?></guid>
  41. <?php if (get_settings('rss_use_excerpt')) : ?>
  42.         <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
  43. <?php else : ?>
  44.         <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
  45.     <?php if ( strlen( $post->post_content ) > 0 ) : ?>
  46.         <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
  47.     <?php else : ?>
  48.         <content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
  49.     <?php endif; ?>
  50. <?php endif; ?>
  51.         <wfw:commentRSS><?php echo comments_rss(); ?></wfw:commentRSS>
  52. <?php rss_enclosure(); ?>
  53.     </item>
  54.     <?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?>
  55. </channel>
  56. </rss>
  57.